Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1107: log unmapped exceptions in addition to mapping #1112

Merged
merged 1 commit into from
May 22, 2024

Conversation

tatu-at-datastax
Copy link
Contributor

What this PR does:

Adds error logic for unmapped exceptions by Data API.

Which issue(s) this PR fixes:
Fixes #1107

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this May 22, 2024
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner May 22, 2024 18:53
logger.error(
String.format(
"Unrecognized exception caught, mapped to SERVER_UNHANDLED_ERROR: %s", message),
throwable);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will log, including stack trace, when Throwable passed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible for this to be tied to tenant ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try to see: cannot pass directly (one of things I dislike about Dependency Injection style), but perhaps there's a way with context (MDC?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we do set tenantId entry of MDC in MeteredCommandProcessor. And assuming the new logger uses default formatting, and that is includes contents of MDC under "mdc" key (which I think) happens, I think it should be automatically included.

@tatu-at-datastax tatu-at-datastax merged commit f3af0d0 into main May 22, 2024
3 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/1107-log-unmapped-exceptions branch May 22, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants